<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8" />
  <title>后盾人</title>
</head>

<body></body>

<script>
  class User {
    constructor(...args) {
      this.name = args[0];
      this.age = args.reverse()[1];
    }
  }

  class Star extends User {
    constructor(...args) {
      super(...args)
      this.age4 = args.reverse()[0]
    }
  }
  let llq = new Star('lilanqingh', 2011, 14)
  console.log(llq);



  class Arr extends Array {
    constructor(...args) {
      super(...args);
      this.gds = 15
    }
    first() {
      return this[0];
    }
    max() {
      return this.sort((a, b) => b - a)[0];
    }
    add(item) {
      this.push(item);
    }
    remove(value) {
      let pos = this.findIndex(item => item == value);
      // console.log(pos);
      super.splice(pos, 1);
    }
  }
  let hd = new Arr(1, 2, 3);
  hd.remove(3);
  console.log(hd);

  console.dir(Arr);
  console.dir(User);



  let obj = {
    methods: 1,
    created: 2,
    switch: 3,
    watch: {
      age: 1
    }
  }
  let obj1 = { ...obj, name: 'llq' }
  let arr1 = [12,12,54,8,48]
  let a = 'gas'
  console.log(...a);


</script>

</html>